import {http} from "@/utils/index.jsx";


// 分页获取所有数据
export function  getApplicantListAPI(cur,pageSize){
return http({
    method:'GET',
    url:'/applicant/list',
    params:{
        cur,pageSize
    }
})
}

// 获取所有数据条数
export function getApplicantCountAPI() {
    return http({
        method:'GET',
        url:'/applicant/allCount',
    })
}

// 根据id查询
export function getApplicantInfoAPI(id) {
    return http({
        method:'GET',
        url:`/applicant/getInfo/${id}`,
        params:{
            id
        }
    })
}

// 新增
export function addOneApplicantAPI(oneApplicant) {
    return http({
        method:'POST',
        url:'/applicant/save',
        data:oneApplicant
    })
}
// 删除
export function deleteOneApplicantByIdAPI(id) {
    return http({
        url:`/applicant/remove/${id}`,
        method:'DELETE',
       params:{
            id
       }
    })
}
// 修改
export function updateOneApplicantAPI(oneApplicant) {
    return http({
        url:'/applicant/update',
        method:'put',
        data:oneApplicant
    })
}

// 根据发起人名称、项目名称查询（用list，可能有1个或者多个）数量
export function getApplicantCountByNameAPI(name) {
    return http({
        method:'GET',
        url:`/applicant/getByNameCount`,
        params:{
            name
        }
    })
}
// 根据发起人名称、项目名称查询（用list，可能有1个或者多个）
export function getApplicantListByNameAPI(name,cur,pageSize) {
    return http({
        method:'GET',
        url:`/applicant/getByName`,
        params:{
            name,
            cur,
            pageSize
        }
    })
}

